package ge.testes;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;


import ge.escola.Disciplina;
import ge.escola.Sala;


public class DisciplinaTest {
	
	Disciplina disciplina;
	Sala sala;
	
	@Before
	public void Disciplina() throws Exception{
		sala = new Sala(123,25,"teste");
		disciplina = new Disciplina("matematica",sala,40,"001");		
	}
	
	@Test
	public void testDisciplina(){
		Assert.assertEquals("matematica",disciplina.getNome());
		Assert.assertEquals(123,disciplina.getSala());
		Assert.assertEquals("001",disciplina.getCodigo());
		Assert.assertEquals(40,disciplina.getCargaHoraria());
		
		disciplina.setNome("portugues");
		Assert.assertEquals("portugues",disciplina.getNome());
		
		disciplina.setCargaHoraria(12);
		Assert.assertEquals(12,disciplina.getCargaHoraria());
		
	}
	
	@Test
	public void testEquals() throws Exception{
		Disciplina disciplina2 = new Disciplina("matematica",sala,40,"001");
		Assert.assertTrue(disciplina.equals(disciplina2));
	}
	
	@Test
	public void testToString(){
		Assert.assertEquals("Codigo: 001 | Disciplina: matematica | Sala: 123",disciplina.toString());
	}
	
}
